.button {
    display: inline-flex;
    height: 36px;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    border-radius: 6px;
    border: 1px solid var(--neutral-100);
    overflow: hidden;
    font: var(--sm);
    font-weight: 600;
    transition-property: background-color, box-shadow;
    transition-duration: var(--transition-normal);
    text-decoration: none;
    box-shadow: var(--shadow-1);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    user-select: none;
    -webkit-user-select: none;

    &:hover {
        background-color: var(--neutral-100);
        cursor: pointer;
    }

    svg.lucide {
        cursor: pointer;
        width: 20px;
        height: 20px;
        margin: 8px;
        margin-right: 0;
        transition-property: stroke;
        transition-duration: var(--transition-normal);

        &:hover {

            rect,
            path {
                stroke: var(--neutral-900);
            }
        }
    }

    &:active {
        box-shadow: none;
        transform: scale(0.98);
        transition: transform var(--transition-fast) ease-out;
    }

    &.primary {
        background-color: var(--neutral-900);
        color: var(--neutral-50);

        svg.lucide {
            line,
            circle,
            rect,
            path {
                stroke: var(--neutral-50);
            }
        }

        &:hover {
            background-color: var(--neutral-700);

            svg.lucide {
                line,
                circle,
                rect,
                path {
                    stroke: var(--neutral-50);
                }
            }
        }
    }

    &.danger {
        background-color: var(--red-600);
        color: var(--neutral-50);

        &:hover {
            background-color: var(--red-700);
        }
    }

    &[disabled] {
        opacity: 0.8;
        cursor: not-allowed;
    }

    a {
        height: 34px;
        line-height: 1;
    }
}

.ghost-button {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: var(--spacing-1) 10px;
    font: var(--sm);
    font-weight: 600;
    transition: background-color var(--transition-normal);
    border: none;
    background: none;
    border-radius: 4px;

    &:hover {
        background-color: var(--neutral-100);
    }

    &:active {
        transform: scale(0.98);
        transition: transform var(--transition-fast) ease-out;
    }

    &[disabled] {
        opacity: 0.5;
        cursor: not-allowed;
    }
}

@media (prefers-color-scheme: dark) {
    .button {
        &.danger {
            color: var(--text-primary);
        }
    }
}

[data-theme="dark"] {
    .button {
        &.danger {
            color: var(--text-primary);
        }
    }
}